package com.aaa.controller;

import com.aaa.entity.MyReturn;
import com.aaa.service.TestTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Author: whr
 * @Description testType控制层
 * @Date 2022.07.04
 * @Modifiel
 */
@Controller
@RequestMapping("testType")
public class TestTypeController extends BaseController{

    @Autowired
    private TestTypeService testTypeService;

    MyReturn myReturn = new MyReturn();

    /**
     * 查询出所有测试类型并赋值到MyReturn传递到前台
     * @return MyReturn
     */
    @ResponseBody
    @RequestMapping("select.do")
    public MyReturn selectTestType(){
        List<String> testTypeList = testTypeService.selectTestType();
        if (null!=testTypeList && testTypeList.size()>0){
            myReturn.setData(testTypeList);
            return super.getSuccessResult(myReturn);
        }
        return super.getFailResult(myReturn);
    }
}
